/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2019-2019. All rights reserved.
 * Description: add log for coredump
 * Author: nixiaoming
 * Create: 2019-04-15
 */

#ifndef _LINUX_RTOS_COREDUMP_DEBUG_H_
#define _LINUX_RTOS_COREDUMP_DEBUG_H_

/*
 * You don't need to use the config macro in the location you use, because:
 * 1. The else branch has been made in the .h file
 *    for the scene where the macro is closed.
 * 2. The log function itself already has the word RTOS,
 *    which can easily identify whether it is a self-developed code.
 */
#ifdef CONFIG_RTOS_COREDUMP_DEBUG_LOG

#define rtos_coredump_log(fmt, ...) \
	pr_info("coredump:%s %d,task %s %d %d:"fmt, __func__, __LINE__, \
		current->comm, current->pid, current->tgid, ##__VA_ARGS__)
#else
#define rtos_coredump_log(fmt, ...) do {} while (0)
#endif

#endif
